package com.smartbone.entity;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Stocktransaction entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "stocktransaction", catalog = "stockmaster", uniqueConstraints = @UniqueConstraint(columnNames = "stockId"))
public class Stocktransaction implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -8817649223963837650L;
	private Long id;
	private Stockinfo stockinfo;
	private Timestamp date;
	private Float openPrice;
	private Float closePrice;
	private Float maxPrice;
	private Float minPrice;
	private Float amount;

	// Constructors

	/** default constructor */
	public Stocktransaction() {
	}

	/** full constructor */
	public Stocktransaction(Stockinfo stockinfo, Timestamp date,
			Float openPrice, Float closePrice, Float maxPrice, Float minPrice,
			Float amount) {
		this.stockinfo = stockinfo;
		this.date = date;
		this.openPrice = openPrice;
		this.closePrice = closePrice;
		this.maxPrice = maxPrice;
		this.minPrice = minPrice;
		this.amount = amount;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "stockId", unique = true, nullable = false)
	public Stockinfo getStockinfo() {
		return this.stockinfo;
	}

	public void setStockinfo(Stockinfo stockinfo) {
		this.stockinfo = stockinfo;
	}

	@Column(name = "date", nullable = false, length = 19)
	public Timestamp getDate() {
		return this.date;
	}

	public void setDate(Timestamp date) {
		this.date = date;
	}

	@Column(name = "openPrice", nullable = false, precision = 12, scale = 0)
	public Float getOpenPrice() {
		return this.openPrice;
	}

	public void setOpenPrice(Float openPrice) {
		this.openPrice = openPrice;
	}

	@Column(name = "closePrice", nullable = false, precision = 12, scale = 0)
	public Float getClosePrice() {
		return this.closePrice;
	}

	public void setClosePrice(Float closePrice) {
		this.closePrice = closePrice;
	}

	@Column(name = "maxPrice", nullable = false, precision = 12, scale = 0)
	public Float getMaxPrice() {
		return this.maxPrice;
	}

	public void setMaxPrice(Float maxPrice) {
		this.maxPrice = maxPrice;
	}

	@Column(name = "minPrice", nullable = false, precision = 12, scale = 0)
	public Float getMinPrice() {
		return this.minPrice;
	}

	public void setMinPrice(Float minPrice) {
		this.minPrice = minPrice;
	}

	@Column(name = "amount", nullable = false, precision = 12, scale = 0)
	public Float getAmount() {
		return this.amount;
	}

	public void setAmount(Float amount) {
		this.amount = amount;
	}

}